package cn.lingyangwl.agile.common.datasource;

import cn.lingyangwl.agile.model.module.mq.AbstractMQ;
import cn.lingyangwl.agile.model.module.mq.BaseMqPayload;
import lombok.*;

/**
 * 定义MQ消息格式
 * 业务场景： 删除应用
 *
 * @author shenguangyang
 */
@Getter
@Setter
public class UserDeleteMQ extends AbstractMQ {
    /**
     * 删除系统用户
     */
    public static final String EXCHANGE = "user.delete";
    public static final String KEY = "";

    public UserDeleteMQ(MsgPayload msgPayload) {
        super(msgPayload);
    }

    /**
     * 定义Msg消息载体
     */
    @Data
    @Builder
    @EqualsAndHashCode(callSuper = true)
    @AllArgsConstructor
    @NoArgsConstructor
    public static class MsgPayload extends BaseMqPayload {
        /**
         * 用户id
         */
        private Long userId;
    }


    public static UserDeleteMQ build(Long userId) {
        return new UserDeleteMQ(new MsgPayload(userId));
    }
}
